Arithmetic circuit for obtaining the vector product of two vectors

ABSTRACT

In an arithmetic circuit, a first input of m bits representing the vector expression of a first set of elements of a finite field GF(2m) is converted into the components of a matrix, and each component of the matrix is multiplied by second input of m bits representing the vector expression of a second set of elements of the finite field. A vector product of the first and second inputs is thereby obtained.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to an arithmetic circuit applied to an encoder and a decoder of an error correction code.

2. Background of the Invention

When a digital video signal, a digital audio signal and the like are recorded and reproduced, an adjacent code or Reed-Solomon code is practically normally used as an error correction code. Parity data (redundant data) is generated in an encoder of such error correction signal, and a syndrome is generated in a decoder from a received word including the parity data. Error correction is performed using the syndrome. An arithmetic circuit for processing the elements of a finite field is used as the hardware of the parity generating circuit, the syndrome generating circuit and the error correction circuit. The finite field is a field of pm elements derived from an irreducible polynomial of m-th order, and the case where p=2 is important for the error correction code. Consequently, this invention is applied to the finite field where p=2.

In a conventional arithmetic circuit used in an encoder and a decoder, when multiplication of elements of the finite field is executed, for example, in the case of (αi, αj), αi is stored in a ROM (read-only memory) so as to obtain the exponent i and αj is similarly stored in a ROM so as to obtain the exponent j. An adder produces the exponent (i+j) which is stored in a ROM, whereby conversion to αi+j is achieved. In the finite field GF (2m), addition (also subtraction) can be simply implemented using an exclusive-OR gate, but as clearly seen from above-mentioned example, a number of ROMs and registers are required to execute multiplication or division and thereby the scale of the circuit is inevitably enlarged. Moreover, the conventional arithmetic circuit is constituted by dedicated hardware of each kind of polynomial or operation and therefore cannot be used for general purposes.

SUMMARY OF THE INVENTION

Accordingly, an object of the invention is to provide an improved arithmetic circuit wherein the necessary amount of memories such as ROMs and registers is decreased and the scale of the circuit is reduced.

Another object of the invention is to provide an arithmetic circuit that can execute an operation such as multiplication, division or raising to a power, using arbitarary elements of a finite field.

Still another object of the invention is to provide an arithmetic circuit that is suitable for use as an encoder and a decoder of an error correction code.

According to this invention, a first input of m bits, being a vector expression of the elements of a finite field GF (2m), is converted into components of a matrix expression of the same components. Each component of the matrix is multiplied with a second input of m bits which are a vector expression of the elements of the finite field GF (2m). This multiplication of the first and second inputs is obtained as a vector expression of the finite field GF (2m).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram illustrating the relation between the elements of a finite field and the matrix expression thereof;

FIG. 2 is a connection diagram of a converter to convert data of a vector expression into components of a matrix expression;

FIG. 3 is a connection diagram of an embodiment of the invention;

FIG. 4 is a block diagram of another embodiment of the invention;

FIG. 5 is a time chart illustrating operation of embodiment in FIG. 4;

and FIG. 6 is a connection diagram of still another embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

An embodiment of the invention will now be described regarding the finite field GF (2m) for easy understanding.

First, the relation between a generator polynomial g(x) and an element αi of GF (2m) will be described. For example, assume that g(x)=x⁴ +x+1. The coefficients of the generator polynomial g(x) in power descending order are respectively (1, 0, 0, 1, 1). Corresponding to the coefficients, a shift register circuit having a feedback loop can be constituted as shown in FIG. 1(A). In FIG. 1(A), an adder inserted between a register of the first stage and a register of the next stage adds (mod. 2).

If an initial value (1000) is set in the shift register circuit as shown in FIG. 1(B) and then the shift operation is executed in sequence, the content of each register varies as shown in FIG. 1(B). If the root of g(x)=0 is made α(=α¹), α⁴ +α+1=0 hence α⁴ =α+1. Consequently, variation in the content of the registers shown in FIG. 1(B) is expressed as a power of α as follows: ##EQU1##

Elements having a value of α⁴ or more are expressed as linear combinations of α^(o), α¹, α², α³ using the equation (α⁴ =α+1). That is, ##EQU2## Thus the expression of α⁴ or more using a vector expression of α⁰ -α³ is shown in FIG. 1(B).

Next, a relation between α and the matrix T will be described. If g(x)=x⁴ +x+1, the adjoint matrix T becomes ##EQU3## If α^(i) is FIG. 1(B) in a column vector, it follows that

    T=[α.sup.1, α.sup.2, α.sup.3, α.sup.4 ]

Then T² becomes ##EQU4## Expressing T² using α^(i), it follows that T² =[α², α³, α⁴, α⁵ ]. That is,

    T.sup.i =[α.sup.i, α.sup.i+1, α.sup.i+2, α.sup.i+3 ]

wherein i=0, 1, 2, . . . , 14, and i+1, i+2, i+3 may be estimated in (mod. 15). In other words, the first row of T^(i) is coincident with α^(i), the vector expression of α.

Next, the expression α^(i) ×α^(j) =α^(i+j) will be described. Although vectors cannot be mutually multiplied, a matrix can be multiplied with a vector. Consequently, if the α^(i) is converted into the matrix expression T^(i), the multiplication of α^(i) ×α^(j) becomes possible. The multiplication of T with α is ##EQU5## If i=2 or more, it follows that

    T×α.sup.i =T×α×α.sup.i-1 =α.sup.2 ×α.sup.i-1 =α.sup.i+1

It is understood generally that Tα^(i) =α^(i+1). From this relation, it follows that

    α.sup.4 =Tα.sup.3 =T.sup.2 α.sup.2 =T.sup.3 α.sup.1 =T.sup.4 α.sup.o

In general, the expression α^(i+j) =T^(i) ·α^(j) holds. As a result of the above relation, the α^(i) and the T^(i) may be deemed identical in multiplication, and therefore in order to calculate the expression α^(i) ×α^(j), the expression T^(i) ×α^(j) may be calculated.

Since T^(i) may be expressed as T^(i) =[α^(i), α^(i+1), α^(i+2), α^(i+3) ] as above described, if another vector can be produced from α^(i), it follows that all components of the matrix T^(i) can be known. Consequently, by multiplying these components with α^(j), the multiplication of (α^(i) ×α^(j)) can be executed.

FIG. 2 shows a circuit for converting α¹ expressed as a vector into a matrix expression T¹ wherein g(x)=x⁴ +x+1. Using the shift register circuit having the feedback loop shown in FIG. 1(A), each register α^(i) is set and the shift operation is executed three times so as to generate α^(i+1), α^(i+2), α^(i+3) in sequence. Consequently, four registers 1, 2, 3, 4 in FIG. 2 are supplied with α^(i), say α¹, from outside, and, by means of a connection equivalent to thence shift operations, the components of the matrix T¹ can be generated simultaneously at the outputs of the four input registers at positions shown by broken lines in FIG. 2. That is, the output side of the registers 1 through 4 is shifted downwards by one bit, and the most significant bit and the least significant bit are added by adders 22, 23, 24 (mod. 2) at every shifting operation.

FIG. 3 shows a circuit construction showing an embodiment of the invention, wherein the inputs α^(i) (a_(o), a₁, a₂, a₃ from the LSB (least significant bit)) are supplied. Coefficients g_(i) of the generator polynomial g(x) are supplied to cascade connected registers 5, 6, 7, and the coefficients g₃, g₂, g₁ are taken from the registers 5, 6, 7. If g(x)=x⁴ +x+1, it follows that g₁ -1, g₂ =g₃ =0. The coefficient g₁ is supplied to AND gates 8, 11, 14, the coefficient g₂ is supplied to AND gates 9, 12, 15, and the coefficient g₃ is supplied to AND gates 10, 13, 16.

Outputs of the AND gates 8, 9, 10 are supplied to exclusive-OR gates (hereinafter referred to as EXOR gates) 22, 32, 42 respectively at respective first inputs of the EXOR gates. Outputs of the AND gates 11, 12, 13 are supplied to EXOR gates 23, 33, 43 respectively at respective first inputs thereof. Outputs of the AND gates 14, 15, 16 are supplied to EXOR gates 24, 34, 44 respectively at respective first inputs thereof. The respective sets of the three AND gates in each line are commonly supplied with the MSB (most significant bit) from the previous line. The respective sets of the three AND gates in each line always become 0 when the coefficient g_(i) of the generator polynomial is 0, and the former supplies the feedback data to the EXOR gate when the coefficient g_(i) is 1. For example, when g₁ =1 and g₂ =g₃ =0, the EXOR gates 22, 23, 24 act as an adder mod. 2 and other EXOR gates only make the state of the preceding AND gates pass as it is.

Consequently, the MSB in the previous line and outputs of the EXOR gates 22, 23, 24, . . . , 44 constitute all the components of a matrix corresponding to the inputs a₀ through a₃. Elements (b_(o), b₁, b₂, b₃) of another field GF(2m) multiplied with the inputs converted into a matrix expression are written in registers 51, 52, 53, 54. The multiplication of the elements (b_(o), b₁, b₂, b₃,) by the matrix components is represented by ##EQU6## and the outputs c_(o), c₁, c₂, c₃ of the multiplication are as follows: ##EQU7##

The multiplication to generate the output c_(o) is executed by AND gates 61, 62, 63, 64, and the addition is executed by EXOR gates 65, 66, 67. The output of the EXOR gate 67 is stored as c_(o) in a register 101.

The multiplication to generate the output c₁ is executed by AND gates 71, 72, 73, 74, and the addition is executed by EXOR gates 75, 76, 77. The output of the EXOR gate 77 is stored as c₁ in a register 102. Similarly, the output c₂ formed by AND gates 81, 82, 83, 84 and EXOR gates 85, 86, 87 is stored in a register 103, and the output c₃ formed by AND gates 91, 92, 93, 94 and EXOR gates 95, 96, 97 is stored in a register 104.

Thus the circuit shown in FIG. 3 can be used for multiplying the two vectors of the finite field GF(2m) so as to generate a vector product output and change the generator polynomial g(x).

In above-mentioned embodiment of the invention, assume that (a_(o), a₁, a₂, a₃) is input A, (b_(o), b₁, b₂, b₃) is input B, and (c_(o), c₁, c₂, c₃) is output C. Then if α^(N) is supplied as input A, output C of α^(N). B is obtained, wherein N is a value arbitrarily determined among (0, 1, 2, . . . , 2m-2), and α^(N) can be formed by supplying N as the address of a ROM. Similarly, α^(N) can be generated by another ROM so as to form the output C of α^(-N). B, and further α^(-i) can be generated by another ROM so as to form output C of α^(-i) ·B.

Another embodiment of the invention, shown in FIG. 4, is an arithmetic circuit where a multiplier shown in FIG. 3 is used, and various operations as are described above can be executed without using a ROM.

In FIG. 4, reference numerals 111 and 121 designate converters to convert input data expressed as vectors into components of matrix T, and numerals 112 and 122 designate registers of m bits to store inputs to the converters 111 and 121. The converters 111 and 121 are supplied with coefficients of the generation polynominal from a shift register 117. The shift register 117 executes a shift operation in response to a clock CKG. Numerals 113 and 123 designate multiplication gates to execute matrix multiplication of components of the matrix T from the converters 111 and 121 with data of m bits representing a vector. The multiplication gates 113 and 123 are supplied with data of m bits from registers 114 and 124.

Input data to the register 112 is selected by a multiplexer 115 which is controlled by select signal S₁. Input data to the register 114 is selected by a multiplexer 116 which is controlled by select signal S₂. Similarly, the registers 122 and 124 are supplied with data selected by multiplexers 125 and 126, respectively. The multiplexers 125 and 126 are controlled by select signals S₃ and S₄, respectively. The multiplication output of the multiplication gate 113 is supplied to EXOR gate 118; the multiplication output of the multiplication gate 123 is supplied through AND gate 119 to the EXOR gate 118. The AND gate 119 is supplied with a control signal SA, and, if the control signal SA is 1, the addition output (mod. 2) from outputs of both multiplication gates 113 and 123 is taken as output signal C. If the control signal SA is 0, the output of the multiplication gate 113 becomes output signal C.

The multiplexers 115, 116, 125, 126 are supplied with input data of m bits E, A, F, B respectively at data inputs of the multiplexers. The output data C is fed back as additional input data to the multiplexers 115, 116, 125. Further, the multiplication output of the multiplication gate 123 is fed back as additional input data to the multiplexer 126. The output data of the multiplication gate 123 is taken as output data P.

In the arithmetic circuit shown in FIG. 4, the operation mode set by the select signals S₁ -S₄ and the control signal SA will be described.

First, the operation mode will be described when all select signals S₁, S₂, S₃, S₄ are 0 and the control signal SA is 1. Then the input data E, A, F, B are selected by the multiplexers 115, 116, 125, 126 respectively, and the multiplication output of the multiplication gate 123 is supplied through the AND gate 119 to the EXOR gate 118. Consequently, if matrices of the converters 111 and 121 are designated by T₁ and T₂ respectively, the output data C of (C=T₁ A+T₂ B) is obtained. If the input data E and F are α^(i) and α^(j) respectively, it follows that T₁ =T^(i), T₂ =T^(j). Consequently, the operation

    C=T.sup.i ·A+T.sup.j ·B

can be executed. This operation is required in order to implement an error correction circuit.

The operation β^(N) will be described as a second example. Since the number of the power is usually given in binary notation, GF(2⁴) where m=4 will be studied. Then the number of the power N is expressed as follows:

    N=n.sub.o ·2.sup.o +n.sub.1 ·2.sup.1 +n.sub.2 ·2.sup.2 n.sub.3 ·2.sup.3

Consequently, the operation β^(N) is executed as follows:

    β.sup.N =β.sup.n.sbsp.o.sup.+2n.sbsp.1.sup.+4n.sbsp.2.sup.+8n.sbsp.3

    =β.sup.n.sbsp.o ×β.sup.2n.sbsp.1 ×β.sup.4n.sbsp.2 ×β.sup.8n.sbsp.3

wherein n_(o), n₁, n₂, n₃ are 0 or 1. Consequently, β², β⁴, β⁸ may be formed from a given β, and the power operation be executed according to the number of the power.

The procedure during the arithmetic operation of β^(N) will be described referring to FIG. 5. FIG. 5(A) shows clocks of the arithmetic circuit, and the select signals S₁ and S₂ are 0 during the time t₁, t₂ as shown in FIG. 5(B) and FIG. 5(C). Data β of four bits is entered as input data E, and α^(o) (=1000) is entered as input data A, F, B. The select signals S₁ and S₂ become 1 at time t₃ and calculation is started.

Input data β and α^(o) are outputted from the multiplexer 115 and 116 as shown in FIG. 5(D) and FIG. 5(E), and these data are outputted from the registers 112 and 114 with a delay of one clock as shown in FIG. 5(F) and FIG. 5(G). At time t₃, the output of the register 112 becomes β and the output of the register 114 becomes α^(o). Since the control signal SA is 0 and output β of the multiplication gate 113 is fed back through the multiplexer 115 and 116 to the registers 112 and 114, the outputs of the registers 112 and 114 become β at time t₄. The outputs of the registers 112 and 114 become β² at time t₅, and then vary to β⁴, β⁶, β⁸. FIG. 5(H) shows the output of the multiplication gate 113.

The output of the multiplication gate 113 is supplied through the EXOR gate 118 to the multiplexer 125. Select signal S₃ of the multiplexer 125 is changed at every clock corresponding to binary expression of the exponent N (n_(o), n₁, n₂, n₃) as shown in FIG. 5(I). If the select signal S₃ is 0, the input data F (=α^(o)) is selected; if the select signal S₃ is 1, the output data of the multiplication gate 113 is selected. Consequently, the output of the multiplexer 125 becomes β^(n).sbsp.o, β^(2n).sbsp.1, β^(4n).sbsp.2, β^(8n).sbsp.3 in sequence as shown in FIG. 5(K), and the output of the register 122 becomes the output of the multiplexer 125 with a delay of one clock as shown in FIG. 5(M).

Select signal S₄ becomes 1 at time t₄ as shown in FIG. 5(J), and the output of the multiplication gate 123 is selected from input data B (=α^(o)) after time t₄. FIG. 5(L) shows the output of the multiplexer 126, and the output of the multiplexer 126 is taken in the register 124 which produces the output shown in FIG. 5(N). At time t₄, β^(n).sbsp.o from the register 122 and α^(o) from the register 124 are supplied to the multiplication gate 123. The output data P of (α^(o) xβ^(n).sbsp.o =β^(n).sbsp.o) shown in FIG. 5(O) is generated. At time t₅, since the input to the multiplication gate 123 becomes β^(2n).sbsp.1 and β.sup..sbsp.o, the output P of the multiplication gate 123 becomes β^(n).sbsp.o^(+2n).sbsp.1. Similarly, corresponding to the input supplied to the multiplication gate 123 at time t₆, t₇, the output P of β^(n).sbsp.o^(+2n).sbsp.1.sup. +4n.sbsp.2^(+8n).sbsp.3 is obtained from the multiplication gate 123. Although not shown, the output data P is passed through a register and thereby synchronized with the clock and value β⁸ is outputted at time t₈.

The operation mode of β⁻¹ will be described as a third example. In a finite field of GF(2⁴), since an arbitrary element β other than 0 is

    β.sup.15 =1

it follows that

    β.sup.-1 =β14

That is, N may be made (N=14) and if N=(0111) is inputted as a select signal S₃, β⁻¹ is outputted as output data P. In calculating mod. (2m-1), values of N in binary notation may be all converted in order to change N into -N.

In a fourth operation mode of β^(-N), binary notation of the number of power N may be only converted. Consequently, if β is supplied as input data E and α^(o) is supplied as input data A, F, B, and the converted number of the power N as the select signal S₃ is supplied from the LSB in sequence, β^(-N) can be obtained as the output data P.

A fifth operation mode (β^(N) ×γ, β^(-N) ×γ) will be described. This is nearly identical to the second and third operation modes, and γ may be entered as input data B in place of α^(o).

A sixth operation mode (α^(i) x, α^(-i) x) will be described. In this case, α may be supplied as input data E, α^(o) be supplied as input data A, F and γ be supplied as input data B, and further binary notation data of exponent i or -i be supplied from the LSB in sequence.

As shown in FIG. 6, in order to mutually multiply elements of a finite field GF(2⁴) representing vectors, all components of one element in the matrix expression (16 bits) may be entered from input terminal 131 in series to the shift register circuit, and components of 16 bits be multiplied by the vector (b0, b1, b2, b3). In FIG. 6, each register of the shift register circuit is designated by a suffix of each component of the matrix, and AND gates and EXOR gates to constitute the multiplication gate are designated by reference numerals identical to those in FIG. 3. 

What is claimed is:
 1. An arithmetic circuit comprising:means for generating as a first input a first set of m bits representing a first vector of a finite field GF(2m) and for generating as a second input a second set of m bits representing a second vector of said finite field; means for converting said first set of m bits into components of a matrix corresponding to said first vector; and means for multiplying each of said components by said second set of m bits, thereby to obtain as an output a vector product of said first and second inputs.
 2. An arithmetic circuit according to claim 1, in which said converting means comprises a shift register which has a plurality of stages and a feedback loop corresponding to coefficients of a generator polynomial.
 3. An arithmetic circuit according to claim 2, in which said converting means further comprises a clock pulse generator, from which a clock pulse is supplied to said shift register, so that a value stored in said shift register is sequentially shifted in response to said clock signal, and means for generating a plurality of outputs from each stage of said shift register at every clock signal to obtain said components.
 4. An arithmetic circuit according to claim 3, in which said shift register comprises a plurality of sets of exclusive-OR gates which are connected one after another in such a manner that the exclusive-OR gates of one set produce outputs ranging from a most significant bit to a least significant bit that are respectively applied to one bit higher inputs of the exclusive-OR gates of a following set, and that the most significant bit output of the exclusive-OR gates of said one set becomes a least significant bit input of the exclusive-OR gates of said following set.
 5. An arithmetic circuit according to claim 4, in which said multiplying means comprises a plurality of AND gates to which each of said components and each bit of said second set of bits are supplied. 